﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace aspZone.Commerce.Model
{
    public class OrderItem
    {
        public OrderItem()
        {
        }

        public OrderItem(Product product) : this(product, 1) {}

        public OrderItem(Product product, int quantity)
        {
            this.Product = product;
            this.Quantity = quantity;
        }

        public Product Product { get; set; }
        public int Quantity { get; set; }

        public decimal SubTotal
        {
            get
            {
                return Quantity * (Product.Price - Product.DiscountAmount);
            }
        }

        public decimal Handling
        {
            get
            {
                return Quantity * Product.HandlingCharge;
            }
        }

        public decimal Weight
        {
            get
            {
                return Quantity * Product.Weight;
            }
        }
    }
}
